
import {INCREMENT,DECREMENT} from './constant'
export function counterReducer(preState,action){
    const {type,data} = action
    if(type === INCREMENT){
        return preState += data
    }
    if(type === DECREMENT){
        return preState -= data
    }
    return 0
}
